/*
 * station_pass_trainlist.h
 *
 *  Created on: 2013-2-19
 *      Author: panqiuhui
 */

#ifndef STATION_PASS_TRAINLIST_H_
#define STATION_PASS_TRAINLIST_H_
#include <stdbool.h>
#include "traininfo.h"

struct station_pass_traininfo {
	char trainID[TRAINS_TRAINID_LEN];
	char departStation[TRAINS_DEPARTSTATIONS_LEN];
	char departTime[TRAINS_DEPARTTIME_LEN];
	char arriveStation[TRAINS_ARRIVESTATIONS_LEN];
	char arriveTime[TRAINS_ARRIVETIME_LEN];
	char stationName[STATIONS_STATION_NAME_LEN];
	char startTime[THROUGH_STATIONS_DEPART_TIME_LEN];
	char endTime[THROUGH_STATIONS_ARRIVE_TIME_LEN];
	char consumeTime[THROUGH_STATIONS_CONSUME_TIME_LEN];
};

typedef struct station_pass_traininfo StationPassTrainItem;

typedef struct station_pass_train_node {
	StationPassTrainItem item;
	struct station_pass_train_node *next;
} StationPassTrainNode;

typedef StationPassTrainNode * StationPassTrainList;

void InitializeListStationPassTrain(StationPassTrainList * plist);

bool ListIsEmptyStationPassTrain(const StationPassTrainList * plist);

bool ListIsFullStationPassTrain(const StationPassTrainList * plist);

unsigned int ListItemCountStationPassTrain(const StationPassTrainList * plist);

bool AddItemStationPassTrain(StationPassTrainItem item,
		StationPassTrainList *plist);

void TraverseStationPassTrain(const StationPassTrainList * plist,
		void (*pfun)(StationPassTrainItem item));

void EmptyTheListStationPassTrain(StationPassTrainList * plist);

#endif /* STATION_PASS_TRAINLIST_H_ */
